﻿using AccustomeAttributedll;
using ISaveReaddll;

namespace FinalTestMachine.Funs
{
    class FunSocketSettings : FunsSelectionHelperbase
    {
        public static readonly FunSocketSettings Cur = new FunSocketSettings();

        private FunSocketSettings()
        {
            Read();
        }
        public static FunSocketSettings CreateInstrance()
        {
            return Cur;
        }

        [SaveRemark]
        [FunctionSelectionRemark("载具A开合感应", new string[] { "启用", "禁用" }, 0)]
        public bool IsUseSocketASensor = true;

        [SaveRemark]
        [FunctionSelectionRemark("载具B开合感应", new string[] { "启用", "禁用" }, 0)]
        public bool IsUseSocketBSensor = true;

        [SaveRemark]
        [FunctionSelectionRemark("载具C开合感应", new string[] { "启用", "禁用" }, 0)]
        public bool IsUseSocketCSensor = true;

        [SaveRemark]
        [FunctionSelectionRemark("载具D开合感应", new string[] { "启用", "禁用" }, 0)]
        public bool IsUseSocketDSensor = true;

        [SaveRemark]
        [FunctionSelectionRemark("载具E开合感应", new string[] { "启用", "禁用" }, 0)]
        public bool IsUseSocketESensor = true;

        [SaveRemark]
        [FunctionSelectionRemark("载具F开合感应", new string[] { "启用", "禁用" }, 0)]
        public bool IsUseSocketFSensor = true;

        [SaveRemark]
        [FunctionSelectionRemark("载具A", new string[] { "启用", "禁用" }, 0)]
        public bool IsUseSocketA = true;

        [SaveRemark]
        [FunctionSelectionRemark("载具B", new string[] { "启用", "禁用" }, 0)]
        public bool IsUseSocketB = true;

        [SaveRemark]
        [FunctionSelectionRemark("载具C", new string[] { "启用", "禁用" }, 0)]
        public bool IsUseSocketC = true;

        [SaveRemark]
        [FunctionSelectionRemark("载具D", new string[] { "启用", "禁用" }, 0)]
        public bool IsUseSocketD = true;

        [SaveRemark]
        [FunctionSelectionRemark("载具E", new string[] { "启用", "禁用" }, 0)]
        public bool IsUseSocketE = true;

        [SaveRemark]
        [FunctionSelectionRemark("载具F", new string[] { "启用", "禁用" }, 0)]
        public bool IsUseSocketF = true;

        public bool CheckSocketCanUse(string para)
        {
            para = "IsUseSocket" + para;
            return GlobalParams.GetFieldValue<bool>(Cur, para);
        }
    }
}
